package com.demons.demonsojcodesandbox.controller.security;

import java.security.Permission;

public class MySecurityManger extends SecurityManager {

    @Override
    public void checkPermission(Permission perm) {
        //默认全开
//        super.checkPermission(perm);
    }

    //检查是否可执行
    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("权限不足" + cmd);
    }
//
//    //检查是否可执读
//    @Override
//    public void checkRead(FileDescriptor read) {
//        throw new SecurityException("权限不足" + read);
//    }

    //检查是否可执写
    @Override
    public void checkWrite(String file) {
        throw new SecurityException("权限不足" + file);
    }

    //检查是否可执删
    @Override
    public void checkDelete(String file) {
        throw new SecurityException("权限不足" + file);
    }

    //检查是否可执连接网络
    @Override
    public void checkConnect(String host, int port) {
        throw new SecurityException("权限不足" + host + port);
    }
}
